﻿<%@ Page Title="Recovery" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Recovery.aspx.cs" Inherits="Recovery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style>
    section#bg_content{ padding:0 ; background:none;}
    .bg01{ border:0 none;}
    </style>
   <%-- <link href="js/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.validationEngine.js" type="text/javascript"></script>
    <script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>--%>
    <script  type="text/javascript">
        $(document).ready(function () {
            //            jQuery(".form").validationEngine({ scroll: false, focusFirstField: false });


            $("#dgEmailChange").dialog({
                resizable: false,
                width: 270,
                modal: true,
                autoOpen: false,
                buttons: [{
                    text: "Ok",
                    click: function () {
                        $(this).dialog("close");
                        window.location = "index.aspx";
                    }
                }]
            });
            $("#dgEmailFail").dialog({
                resizable: false,
                width: 270,
                modal: true,
                autoOpen: false,
                buttons: {
                    "OK": function () {
                        $(this).dialog("close");
                    }
                }
            });

        });

        function customValidate(field, rules, i, options) {
            var pattern = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
            var match = pattern.exec(field.val());
            if (field.val() == "") {
                return true;
            }
            else if (match == null) {
                return options.allrules.email.alertText;
            }
        }

        function validateCheckbox() {

            var a = document.getElementById('<%=txtEmailAddress.ClientID %>').value;
            if (a == '') {
                document.getElementById('<%=errorMessage.ClientID %>').innerHTML = 'Please enter email address.'
                return false;
            }

            var pattern = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
            var match = pattern.exec(a);
            if (match == null) {
                document.getElementById('<%=errorMessage.ClientID %>').innerHTML = 'Please enter a valid email address.';
                return false;
            }
            return true;
        }

        
        

        function showDgEmail() {
            $('#dgEmailChange').dialog('open');
            return false;
        }

        function showDgEmailFail() {
            $("#dgEmailFail").dialog("open");
            return false;
        }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <section id="bg_content">
<div class="clearfix clear ">
<div class="bg01">
    	<div class="bg02" style="margin-bottom:10px;">
           <div class="bg03 clearfix">
            <p class="title01">Having trouble signing in?</p>
            <p id="idError" class="errormsg"><asp:Label runat="server" ID="errorMessage"></asp:Label>
            </p>
               	  <p id="text1" class="mar_b10">
                   I don't know my password</p>
                  <div id="divText1" >
                    <p class="text-row">To reset your password, enter the email address you use to sign in to PlanItMeal. This can be your email address.</p>
                    <p class="text-row">Email address</p>
                    <p class="ip-text"><input name="Emai address" id="txtEmailAddress" runat="server" type="text" class="input-trpr" size="30" /></p>
                    </div>
                    </div>
                    <div style=" text-align:center; margin-top:10px;">
                    <asp:Button runat="server" ID="btn_submit" Text="Submit" CssClass="button-form"  OnClientClick="return validateCheckbox();"
                            Onclick="btn_submit_Click"  />
                           </div>
</div>
        </div>
     <%-- <div style="clear:both"></div>--%>
     </div>

</section>
    <div id="dgEmailChange" class="message-diaglog">
        <p>
            Please check your email to change password.</p>
    </div>
    <div id="dgEmailFail" class="message-diaglog">
        <p>
            The send email is fail.</p>
    </div>
</asp:Content>

